import {  message} from 'antd';
import {  user_update} from '../service';
/**
 * 添加节点
 * @param fields
 */
const userUpdate = async (fields: any) => {
const params ={};
params["authority"] = fields["authority"]["value"];
params["is_active"] = fields["is_active"]
params["id"] = fields["id"]
try {
  const t = await user_update({ ...params });
  if (t.code==200){
    message.success(t.msg)
    return t;
  }else{
    if(t.msg){
    message.error(t.msg)
    return {};
    }else{
      message.error(t)
    }
  }
} catch (error) {
  message.error("程序出错")
}
};

export default userUpdate
